
import React from "react";
import One from "./one";
import Tow from "./tow";
import Three from "./three";
import { NavLink, Link, Route, Routes, Navigate } from "react-router-dom";
import "./c.css"
function App() {
    function isActive({ isActive }) {
        return isActive ? "box" : ""
    }
    return (
        <div>
            {/* 路由高亮 class */}
            <NavLink className={isActive} to="/one">去one</NavLink>
            <NavLink className={isActive} to="/tow">去tow</NavLink>
            <NavLink className={isActive} to="/three">去three</NavLink>
            <Routes>
                <Route path="/one" element={<One></One>} />
                <Route path="/tow" element={<Tow />} />
                <Route path="/three" element={<Three />} />
                <Route path="/" element={<Navigate to="/one" />} />
            </Routes>
        </div>
    );
}

export default App;